/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package GUI.Components;

import GUI.Dialogs.BasicDialog;
import java.awt.Window;
import java.awt.event.*;

/**
 * @author David
 */
public class CancelButton extends BButton
{

    /**
     *
     * @param window
     */
    public CancelButton(final Window window)
    {
        setText("Cancel");
        setBorder(new RoundBorder());
        addActionListener(new ActionListener()
        {
            public void actionPerformed(ActionEvent e)
            {
                window.dispose();
            }
        });
    }

    /**
     *
     * @param dialog
     * @param text
     */
    public CancelButton(final BasicDialog dialog, String text)
    {
        setText(text);
        setBorder(new RoundBorder());
        addActionListener(new ActionListener()
        {
            public void actionPerformed(ActionEvent e)
            {
                dialog.dispose();
            }
        });
    }
}
